package cn.topevery.garden.wapi.service.impl;

import cn.topevery.garden.wapi.service.AsyncService;
import hw.topevery.basis.dal.logic.SysLogLogic;
import hw.topevery.basis.entity.po.SysLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class AsyncServiceImpl implements AsyncService {

    @Autowired
    private SysLogLogic sysLogLogic;


    @Override
    @Async("asyncServiceExecutor")
    public void saveOpLog(String userId, SysLog sysLog) throws Exception {
        //Thread.sleep(1000);
        sysLogLogic.save(userId, sysLog);
    }

    @Override
    @Async("asyncServiceExecutor")
    public void executeAsync() throws Exception {
        log.info("save log...");

    }
}
